<?php

class Mod_Page extends CI_Model{
	public function getPageById($id){
		$this->db->select('*')->where(field('id'), $id);
		$result = $this->db->get(table('page'));
		$result = $result->result_array();
		return $result[0];
	}	
	
	public function update($id, $description){
		$data = array(
			field('description') => $description
		);
		$this->db->where(field('id'), $id);
		$result = $this->db->update(table('page'), $data);
		return $this->db->affected_rows($result);
	}
}